package com.health.tablebean;

import java.util.Date;

import android.text.TextUtils;
import net.tsz.afinal.annotation.sqlite.Id;
import net.tsz.afinal.annotation.sqlite.Table;

/**
 * @author Administrator 健康体检_主要用药情况表
 * 
 * 
 */
@Table(name = "ARCHIVE_MEDICATION")
public class ARCHIVE_MEDICATION {
	/** 体检编号（与ARCHIVE_CUSTOMERBASEINFO体检编号关联） */
	private String PHYSICALID;
	/** 编号 */
	@Id(column = "ID")
	private int ID;
	/** 结束时间---弃用 */
	private String ENDTIME;
	/** 药物名称 */
	private String MEDICINALNAME;
	/** 服药依从性 */
	private String PILLDEPENDENCE;
	/** 用药时间 */
	private String STARTTIME;
	/** 用量 */
	private String USENUM;
	/** 使用方法 */
	private String USEAGE;
	/** IDCARD */
	private String IDCARD;
	private String NGUID;
	
	

	public String getNGUID() {
		return NGUID;
	}

	public void setNGUID(String nGUID) {
		NGUID = nGUID;
	}

	public String getIDCARD() {
		return IDCARD;
	}

	public void setIDCARD(String iDCARD) {
		IDCARD = iDCARD;
	}

	public String getPHYSICALID() {
		return PHYSICALID;
	}

	public void setPHYSICALID(String pHYSICALID) {
		PHYSICALID = pHYSICALID;
	}

	public int getID() {
		return ID;
	}

	public void setID(int iD) {
		ID = iD;
	}

	public String getENDTIME() {
		return ENDTIME;
	}

	public void setENDTIME(String eNDTIME) {
		ENDTIME = eNDTIME;
	}

	public String getMEDICINALNAME() {
		return MEDICINALNAME;
	}

	public void setMEDICINALNAME(String mEDICINALNAME) {
		MEDICINALNAME = mEDICINALNAME;
	}

	public String getPILLDEPENDENCE() {
		return PILLDEPENDENCE;
	}

	public void setPILLDEPENDENCE(String pILLDEPENDENCE) {
		PILLDEPENDENCE = pILLDEPENDENCE;
	}

	public String getSTARTTIME() {
		return STARTTIME;
	}

	public void setSTARTTIME(String sTARTTIME) {
		STARTTIME = sTARTTIME;
	}

	public String getUSENUM() {
		return USENUM;
	}

	public void setUSENUM(String uSENUM) {
		USENUM = uSENUM;
	}

	public String getUSEAGE() {
		return USEAGE;
	}

	public void setUSEAGE(String uSEAGE) {
		USEAGE = uSEAGE;
	}

	@Override
	public boolean equals(Object o) {
		if (!(o instanceof ARCHIVE_MEDICATION)) {
			return false;
		}
		ARCHIVE_MEDICATION obj = (ARCHIVE_MEDICATION) o;

		if (notNull(getENDTIME()).equals(notNull(obj.getENDTIME()))
				&& notNull(getIDCARD()).equals(notNull(obj.getIDCARD()))
				&& notNull(getMEDICINALNAME()).equals(
						notNull(obj.getMEDICINALNAME()))
				&& notNull(getPHYSICALID())
						.equals(notNull(obj.getPHYSICALID()))
				&& notNull(getPILLDEPENDENCE()).equals(
						notNull(obj.getPILLDEPENDENCE()))
				&& notNull(getSTARTTIME()).equals(notNull(obj.getSTARTTIME()))
				&& notNull(getUSEAGE()).equals(notNull(obj.getUSEAGE()))
				&& notNull(getUSENUM()).equals(notNull(obj.getUSENUM()))) {
			return true;
		}

		return false;
	}

	private String notNull(String str) {
		if (TextUtils.isEmpty(str)) {
			return "";
		}
		return str;
	}

	private String notNull(int str) {
		if (str == 0) {
			return "0";
		}
		return String.valueOf(str);
	}

	private Date notNull(Date date) {
		if (date == null) {
			return new Date();
		}
		return date;
	}

}
